<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags/loginRegister" %>
<c:set var="basePath" value="${pageContext.servletContext.contextPath}"/>
<t:template> 
	<sec:authorize access="!isAuthenticated()">
	   <span id="welcome">
			<section class="loginform cf">
			    <c:if test="${not empty param.error}">
			    	<div id="loginError">
				     <font color="red">
				       Your login attempt was not successful, try again.<br/><br/>
				       Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.
				     </font>
				     </div>
			    </c:if>	
				<form name="login" action="<c:url value='/j_spring_security_check'/>" method="post">
					<ul>
						<li>
							<label for="username">User ID</label>
							<input id="username" name="j_username" placeholder="Lietotāja numurs" required value="<c:if test="${not empty param.login_error}"> <c:out value="${SPRING_SECURITY_LAST_USERNAME}"/></c:if>" />
						</li>
						<li>
							<label for="password">Password</label>
							<input type="password" id="password" name="j_password" placeholder="Parole" required></li>
						<li>
							<input type="submit" value="Login">
						</li>
					</ul>
				</form>
				<span><a href="${basePath}/bank/ibank/register">Reģistrēties</a></span>
			</section>
		</span>			
	</sec:authorize>
</t:template>
			